﻿@using System.Web.Optimization
@{
    
    Layout = "~/Views/Shared/_PageLayout.cshtml";
}

<script src="~/Scripts/wxzj/easyui/jquery.edatagrid.js"></script>
@*<table class="easyui-datagrid" id="dgRoles"></table>*@
@*<div id="toolbar">
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="javascript:$('#dg').edatagrid('addRow')">New</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="javascript:$('#dg').edatagrid('destroyRow')">Destroy</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-save" plain="true" onclick="javascript:$('#dg').edatagrid('saveRow')">Save</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-undo" plain="true" onclick="javascript:$('#dg').edatagrid('cancelRow')">Cancel</a>
</div>*@
<table id="dg" title="" style="height: 550px"
       toolbar="#toolbar" pagination="true" idfield="id"
       rownumbers="true" fitcolumns="true" singleselect="true">
    <thead>
    <tr>
        <th field="name" width="120" editor="{type:'validatebox',options:{required:true}}">角色名</th>
        <th field="displayName" width="120" editor="{type:'validatebox',options:{required:true}}">角色显示名称</th>
        <th field="creatorUserName" width="120">创建人</th>
        <th field="creationTime" width="120">创建时间</th>
        <th field="lastModifierUserName" width="120">修改人</th>
        <th field="lastModificationTime" width="120">修改时间</th>
    </tr>
    </thead>
</table>
<div id="toolbar">
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="javascript: $('#dg').edatagrid('addRow');">新增</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="roleService.onDelete(); ">删除</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-save" plain="true" onclick="roleService.onSave();">保存</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-undo" plain="true" onclick="javascript: $('#dg').edatagrid('cancelRow');">取消</a>
</div>
<script src="~/Scripts/wxzj/RoleService/roleService.js"></script>
<script type="text/javascript">
    $(function () {
       // $('#dg').edatagrid();
        $('#dg').edatagrid({
            url: 'GetAllRoles'
            //saveUrl: 'AddRole',
            //updateUrl: 'update_user.php',
            //destroyUrl: 'destroy_user.php'
        });
        //abp.services.app.role.getAllRoles().done(function(roles) {
        //    var data = { rows: roles.items, total: roles.items.length };
        //    $('#dg').edatagrid("loadData", data);
        //});
    });
</script>